import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import '_assets/fonts/iconfont.css'
import '_assets/css/base.css'
import '_assets/js/setRem.js'
import loading from './plugins/Loading'
import { Tabbar, TabbarItem, icon, Search, Swipe, SwipeItem, Grid, GridItem, Divider, Card, Tag, Button, PullRefresh, List, NavBar, Popup, GoodsAction, GoodsActionIcon, GoodsActionButton, Sku, Form, Field, Toast, SubmitBar, Stepper, Checkbox, SwipeCell, Dialog, Sticky, Badge, Image as VanImage, CellGroup, Cell, Switch, Area, AddressList, Empty, ContactCard, Lazyload, Calendar } from 'vant'

Vue.use(loading)
Vue.use(Tabbar)
  .use(TabbarItem)
  .use(icon)
  .use(Search)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(Divider)
  .use(Card)
  .use(Tag)
  .use(Button)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(Popup)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Sku)
  .use(Form)
  .use(Field)
  .use(Toast)
  .use(SubmitBar)
  .use(Stepper)
  .use(Checkbox)
  .use(SwipeCell)
  .use(Dialog)
  .use(Sticky)
  .use(Badge)
  .use(VanImage)
  .use(CellGroup)
  .use(Cell)
  .use(Switch)
  .use(Area)
  .use(AddressList)
  .use(Empty)
  .use(ContactCard)
  .use(Calendar)
  .use(Lazyload, {
    lazyComponent: true, // 组件懒加载
    preLoad: 1, // 加载时图片的比例
    error: require('./assets/img/lazy.gif'),
    loading: require('./assets/img/fail.jpeg'),
    attempt: 3 // 当图片请求失败时再请求的次数
  })

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
